home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Palm Z22
/
Palm Z22 CD.iso
/
pc
/
PalmSoftware.pkg
/
Contents
/
Resources
/
postflight
< prev
next >
Wrap
Text File
|
2005-08-11
|
10KB
|
150 lines
#!/bin/sh
# File name: postflight.sh
#
# Description:
#
# Copyright 2004, palmOne , Inc.
#
#
# Modification History:
# <1> 05/06/04 JMP Implemented
#
#
if_not_mkdir () {
if [ ! -e "." ]
then
mkdir "."
fi
}
######## Fixing the Apps in the Applications/Palm folder ###########
"$1/Contents/Resources/CpMac" "$1/Contents/Resources/SetFile" "$2Applications/Palm/SetFile"
chmod 777 "$2Applications/Palm/SetFile"
find "$2Applications/Palm/" -name "HotSync Manager" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/HotSync Manager/Contents/Plug-ins/" -name "USBNotifier" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "HotSync Manager" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile"-c Gld1 -t APPL
find "$2Applications/Palm/" -name "Conduit Manager" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Conduit Manager" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile"-c Gld3 -t APPL
find "$2Applications/Palm/Palm Desktop/Contents/Resources/" -name "Palm Desktop Background.app" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/Palm Desktop/Contents/Resources/" -name "Palm Desktop Support.app" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Palm Desktop" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Palm Desktop" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile" -c POrg -t APPL
find "$2Applications/Palm/" -name "Transport Monitor" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Transport Monitor" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile" -c Gld2 -t APPL
find "$2Applications/Palm/" -name "Palm Setup Assistant" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Palm Setup Assistant" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile" -c PSA0 -t APPL
find "$2Applications/Palm/" -name "Send To Handheld" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Voice Memo" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "Note Pad" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Applications/Palm/" -name "E-Reg" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
if [ -e "$1/../English/Essential_Software/Software Store" ]
then
"$1/Contents/Resources/CpMac" -r "$1/../English/Essential_Software/Software Store" "$2Applications/Palm/Add-On/English/"
fi
find "$2Applications/Palm/" -name "*.pdb" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile" -c Gld1 -t "PDB "
find "$2Applications/Palm/" -name "*.prc" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile" -c Gld1 -t "****"
find "$2Applications/Palm/" -name "*.pdf" -type f -print0 | xargs -0 "$2Applications/Palm/SetFile" -c CARO -t "PDF "
######## copying the Documentation to /Applications/Palm" folder ###########
echo $2 > ~/tmp.txt
#"cat ~/tmp1.txt" | getline fld1; close("cat ~/tmp1.txt");
echo $1 > ~/tmp1.txt
sudo -u $USER "$1/Contents/Resources/LocId.app/Contents/MacOS/LocId" > ~/loc.txt
"$1/Contents/Resources/LocId.app/Contents/MacOS/LocId" | awk ' BEGIN {"cat ~/loc.txt" | getline loc; close("cat ~/loc.txt"); "cat ~/tmp.txt" | getline fld; close("cat ~/tmp.txt");"cat ~/tmp1.txt" | getline fld1; close("cat ~/tmp1.txt");package["English"]= "English/Documentation";package["Anglais"]= "English/Documentation";package["French"]= "Francais/Documentation";package["Francais"]= "Francais/Documentation";package["Italien"]= "Italiano/Documentation";package["Italian"]= "Italiano/Documentation";package["Italiano"]= "Italiano/Documentation";package["German"]= "Deutsch/Dokumentation";package["Deutsch"]= "Deutsch/Dokumentation";package["Deutsch"]= "Deutsch/Dokumentation";package["Spanish"]= "Espanol/Documentacion";package["Espanol"]= "Espanol/Documentacion";package["Portugues"]= "Portuguese/Documentacion";package["Portuguese"]= "Portuguese/Documentacion"}{if (package[loc]=="") lang="English/Documentation"; if (package[loc]!="") lang=package[loc];printf "if [ -e \"%s/../%s\" ]\nthen\n\"%s/Contents/Resources/CpMac\" -r \"%s/../%s\" \"%sApplications/Palm/\"\nfi\n", fld1, lang, fld1, fld1, lang, fld}' > ~/tmp1.sh
chmod 777 ~/tmp1.sh
sh ~/tmp1.sh
######## Fixing the Apps in the "Library/Application Support/Palm HotSync" folder ###########
find "$2Library/Application Support/Palm HotSync/Conduits/" -name "*" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
"$2Applications/Palm/SetFile" -a b "$2Library/Application Support/Palm HotSync/Conduits"
find "$2Library/Application Support/Palm HotSync/Transports/" -name "*" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
"$2Applications/Palm/SetFile" -a b "$2Library/Application Support/Palm HotSync/Transports"
find "$2Library/Application Support/Palm HotSync/Notifiers/" -name "Conflict Notifier" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
find "$2Library/Application Support/Palm HotSync/Notifiers/" -name "Conflict Notifier" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -c Gld1 -t Gldc
######## Deleting our Disabled Conduits if they exist ###########
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Address Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Address Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Contacts Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Contacts Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Calendar Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Calendar Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Datebook Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Datebook Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Memo Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Memo Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Memos Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Memos Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/Tasks Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/Tasks Conduit"
fi
if [ -e "$2Library/Application Support/Palm HotSync/Disabled Conduits/ToDo Conduit" ]
then
rm -rf "$2Library/Application Support/Palm HotSync/Disabled Conduits/ToDo Conduit"
fi
######## Fixing the Apps in the "Library/CFMSupport" folder ###########
find "$2Library/CFMSupport/" -name "Palm Conduit Library.cfm" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
######## Fixing the Apps in the "System/Library/Extensions" folder ###########
find "$2System/Library/Extensions/" -name "HotSync Classic Seize.kext" -type d -print0 | xargs -0 "$2Applications/Palm/SetFile" -a B
chmod 777 "$2Applications/Palm/ConfigLaunchServices"
"$1/Contents/Resources/LocId.app/Contents/MacOS/LocId" | awk ' BEGIN {"cat ~/tmp.txt" | getline fld; close("cat ~/ tmp.txt");printf "\"%sApplications/Palm/ConfigLaunchServices.app/Contents/MacOS/ConfigLaunchServices\" \"%sApplications/Palm\"", fld, fld}' > ~/tmp.sh
chmod 777 ~/tmp.sh
##sudo -u $USER ~/tmp.sh
"$2Applications/Palm/ConfigLaunchServices.app/Contents/MacOS/ConfigLaunchServices" "$2Applications/Palm"
sudo -u $USER "$2Applications/Palm/ConfigLaunchServices.app/Contents/MacOS/ConfigLaunchServices" "$2Applications/Palm"
###########Copying and running the InstallAddOn script
"$1/Contents/Resources/CpMac" "$1/Contents/Resources/InstallAddOn.App" "$2Applications/Palm/Add-On/InstallAddOn.App"
# "$1/Contents/Resources/LocId.app/Contents/MacOS/LocId" > ~/loc.txt
rm -f "$2Applications/Palm/SetFile"
rm -rf "$2Applications/Palm/ConfigLaunchServices.app"
`open -a "$2Applications/Palm/Add-On/InstallAddOn.App"`
##"$2Applications/Palm/Add-On/InstallAddOn.App"
IS_UTIL_RUNNING=0
while [ $IS_UTIL_RUNNING -ne 0 ] ; do
# Only check every 8 seconds to prevent script from hogging the CPU
sleep 8
IS_UTIL_RUNNING="`ps -x -o command | grep "InstallAddOn" | grep -v grep | wc -l`"
done
rm -rf "~/Library/Preferences/Palm Desktop Info"
rm -rf "~/Library/Preferences/PowerReg Prefs"
rm -f ~/tmp.txt
rm -f ~/tmp.sh
rm -f ~/tmp1.sh
sudo chmod 775 "$2"
sudo chown :admin "$2"
sudo chmod 775 "$2Applications"
sudo chown :admin "$2Applications"
sudo chmod -R 775 "$2Applications/Palm"
sudo chown -R :admin "$2Applications/Palm"
sudo chmod 775 "$2Library"
sudo chown :admin "$2Library"
sudo chmod -R 775 "$2Library/CFMSupport"
sudo chown -R :admin "$2Library/CFMSupport"
sudo chmod -R 775 "$2Library/Application Support"
sudo chown -R :admin "$2Library/Application Support"
exit 0